Tips & techniques for Users of Sunsoft Solaris

July 1995

Changing your Solaris configuration with sys-unconfig

In today's computer market, buying a new computer is not always the answer to your system-performance problems. Budgeting often requires you to make the most of the computer equipment you already have. By purchasing faster peripherals to upgrade your computer, you can extend the life of slower equipment.

PC users are familiar with the tasks involved in upgrading. First, you must determine whether your old software will be compatible with the new peripherals you want to purchase. If it is, you then buy the peripherals, install them, and reconfigure your PC to work with them. If you're a Solaris x86 user, reconfiguring your PC may be no ordinary task, since Solaris x86 runs on a wide variety of PC platforms.

Solaris provides several utilities for reconfiguring your computer system. The sys-unconfig utility, available for all Solaris versions, lets you completely reconfigure your system from its default state. The kdmconfig utility lets you configure keyboard, display, and mouse options for OpenWindows without the complete reconfiguration provided by sys-unconfig. Depending on your configuration needs, these two utilities will be all you need to make changes to your Solaris system.

In this article, we'll show you how to use the sys-unconfig and kdmconfig utilities. First, we'll discuss sys-unconfig and how it configures your Solaris system. Then, we'll show you how to make specific configuration changes with the kdmconfig utility.

Getting started

The sys-unconfig and the kdmconfig utilities let you modify your Solaris system configuration files. Because the modifications will be in effect until you next reconfigure the files, you should carefully consider the changes you intend to make. Before you use either utility, you should know the current settings for your configuration prior to making changes. You should be certain of the terminal type, graphics card (x86), screen size, and mouse type

In addition to basic hardware information, you'll also need to have information concerning your network. This includes

Your machine or host name

Your IP address

Your name service (NIS, NIS+, DNS, etc.)

Whether your system is part of a subnet

"Blanking" Solaris with sys-unconfig

In addition to adding new peripherals to a PC, moving a system on your network may require you to reconfigure a Solaris system. When either of these situations occurs, you'll probably use the sys-unconfig utility. Sys-unconfig prepares your system for reconfiguration by setting system default values for several files. This procedure is often referred to as "blanking" a system, since it removes the system name and information concerning other systems from your network. When you look at the tasks that sys-unconfig performs, you can see how your Solaris system distributes and handles configuration files.

The /etc directory contains many of the files that configure your system. Several files in this directory are changed when you run sys-unconfig. Let's take a look at these files and what they do. First, we'll look at the directory /etc/inet, which contains files that configure your Internet addresses and names.

When sys-unconfig runs, the hosts file in the /etc/inet directory is saved under? the filename hosts.saved. The hosts file contains the local host name and IP address as well as the names of other hosts on your Solaris system and their addresses. Sys-unconfig restores the default /etc/inet/hosts file after it creates host.saved.

In addition to the changes it makes to the hosts file, sys-unconfig removes the /etc/inet/netmasks file, which contains your IP and subnet masks for your system. Sys-unconfig will reconfigure these settings after it reboots your system. The /etc/net/*/hosts files contain host information for the hosts on your network. When sys-unconfig executes, host information for the machine running sys-unconfig is deleted from the hosts files in these subdirectories.

In the /etc directory, sys-unconfig changes several files before it reboots your system. These files include

/etc/nodename

/etc/hostname.??

/etc/TIMEZONE -> ./default/init

/etc/shadow

/etc/defaultdomain

In the nodename and hostname.?? files, sys-unconfig removes the default hostname so that you can reconfigure it when the system reboots. The TIMEZONE file, which is symbolically linked to the file /etc/default/init, changes so that Pacific Standard Time becomes the system's default time zone. In addition, the utility removes the net domain name from the /etc/defaultdomain file.

The password for the super-user root is encrypted in the /etc/shadow file. Before rebooting, sys-unconfig removes the root password from /etc/shadow. You will set a new root password during the reconfiguration of your Solaris system.

If you're using NIS or NIS+, sys-unconfig disables this naming service as part of the unconfiguring process. Once sys-unconfig completes these changes to your Solaris system, it will reboot your system and run several programs to set new values for the changes made.

Configuring after reboot: sysidtool and sysidconfig

Once sys-unconfig "blanks" your Solaris system, several configuration applications run upon rebooting. The sysidtool utility, which executes after a reconfiguration reboot, will reset the blanked values for the files that sys-unconfig changed or removed.

The sysidtool utility is a suite of four configuration programs that run after a system has been unconfigured. The four programs that make up sysidtool include

/usr/sbin/sysidnet

/usr/sbin/sysidnis

/usr/sbin/sysidsys

/usr/sbin/sysidroot

In addition to these programs, you can configure other applications to run with the sysidconfig utility. To add an application to the sysidconfig list, run the command

sysidconfig -a application_name

By default, SPARC systems have no additional configuration programs in the sysidconfig list. The kdmconfig utility, which is installed on Solaris x86 systems only, is enabled in the sysidconfig list for these computers. We'll discuss the kdmconfig utility for x86 systems later in this article.

The sysidtool programs set up the appropriate information in the machine's configuration files, in the kernel, and in the machine's network interface. Each of the four programs will prompt you for responses to questions about portions of your configuration, as shown in Table A. Once you've answered the questions from each sysidtool program, your system will boot to a login with the new configuration data applied.

TABLE A

sysidnet: network configuration

Machine's default location

Machine's console type

Machine's host name

Machine's IP address

sysidnis: NIS or NIS+ client configuration

Name Service: NIS+, NIS, other, or none

Machine's IP subnet mask (if no NIS or NIS+ server can be located on the machine's sub-network)

NIS or NIS+ domain name

Host name and IP address of NIS or NIS+ server in the domain

sysidsys: misc. system configuration

Machine's IP subnet mask (if no NIS or NIS+ server can be located on machine's sub-network)

Machine's time zone

Date and time

sysidroot: control super-user

Machine's root password

On x86 systems, it's possible to reconfigure a portion of your system without running the sys-unconfig utility. You can run the kdmconfig utility from the command line to reconfigure several hardware settings.

Using kdmconfig on x86 systems

On x86 systems, you can use the kdmconfig utility from the command line to change the keyboard, mouse, and display options for OpenWindows on a client machine. In addition, you can use kdmconfig to configure the keyboard, pointer and display entries in the bootparams database on a Solaris server. Let's look at how you can use kdmconfig to modify a client's configuration and then demonstrate how to change the bootparams database on a server.

To change a client machine's keyboard, mouse, or display set up, log into the server as root and, at the command line, enter the command

#kdmconfig -u

This returns the configuration files

/etc/defaultkb

/etc/openwin/server/etc/OWconfig

to their unconfigured state. You must perform this step first because kdmconfig doesn't allow you to edit these files in a configured state. Once you've run the -u option, you can enter the command

#kdmconfig -cf

This will run kdmconfig in forced screen mode. When run in forced screen mode, kdmconfig lets you choose from menu screens the settings you want to change for your keyboard, mouse, or display.

To change a server's /etc/bootparams configuration file, be sure that NIS or NIS+ is the naming service you're using. Without NIS or NIS+ enabled, any attempt to access the bootparams file from a remote station will return the error

The /etc/nsswitch.conf file on this machine does not have the /etc/bootparams database mapped to a local file. Please change this to a local file before running kdmconfig with the -s <client> option.

With NIS or NIS+ enabled, you can change the configuration for any server on the same subnet. The server must have the bootparamd daemon running in order for a client to access the /etc/bootparams file. With these provisions, you can change a server's keyboard, mouse, and display settings for clients using the server/ Simply use the command

#kdmconfig -cfs servername

This will allow you to make changes to the configuration by choosing settings from menus.fa

Conclusion

Upgrading to new hardware often requires that you reconfigure your computer system. In this article, we examined the sys-unconfig utility and explained how you can use it to reconfigure Solaris smoothly and quickly. If you're using an x86 version of Solaris, the kdmconfig utility lets you make minor changes to your system configuration without interrupting other network tasks.


[Return to Index for Inside Solaris - July Issue]

Copyright (c) 1995 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved.

Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis

Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of

Ziff-Davis Publishing Company.

Inside Solaris is a publication of The Cobb Group.
1-800-223-8720